Surface hidden counts for TopFiles and Collaborators in DevProfile#9
Merged
Surface hidden counts for TopFiles and Collaborators in DevProfile#9
Conversation
Completes the hidden-counter family started with Scope/Extensions. TopFiles truncates at 10 and Collaborators at 5; both used to drop buckets silently. A dev with 25 touched files or 12 frequent collaborators looked like they had exactly 10/5 — reader had no way to tell "this is the whole footprint" apart from "this is a sample of a larger set". The k8s-release-robot profile is a good example: 62 distinct collaborators and 18 top files, previously collapsed to the displayed top-N without trace. Add TopFilesHidden and CollaboratorsHidden fields on DevProfile; populate at the truncation sites. Render in three surfaces matching the established pattern: - CLI PrintProfiles: inline "(+N more)" on the Collaboration line, standalone " ... (+N more files not shown)" after Top files. - HTML main report profile card: italic span on Collaboration, italic div below Top files. - HTML dedicated profile: italic chip after Collaborators, colspan-4 row at the bottom of the Top Files table. Silent when Hidden == 0 (the common case) so reports of tight teams don't gain noise. Tests: TestDevProfileHiddenCountersTopFilesAndCollaborators constructs a dev with 18 authored files and 6 collaborators, asserts TopFilesHidden=8 and CollaboratorsHidden=1. TestDevProfileHiddenCountersZeroWhenFits extended to pin both new counters to 0 in the no-truncation case. Verified on kubernetes/k8s-release-robot: CLI shows "(+57 more)" on Collaboration and "(+8 more files not shown)" at bottom of Top files; HTML dedicated profile shows both markers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Sibling to the profile hidden counters from the previous commit, but different pattern: top-level tables in the HTML report now show their universe size inline in the h2 (e.g. "Top Contributors 20 of 5,295") when truncation is in effect. Silent when the displayed list is the whole set. Rationale vs "+N more" rows at table bottoms: user passed --top N explicitly, so they know truncation happened — the useful signal is *how big is the repo*, not *was something hidden*. 5,295 devs vs 40 devs is diagnostic information the reader wants at a glance. Bottom-of-table "+N more" would also compound across 7 tables visually. Header badge: one line per section, no reading weight added. Applied to 7 tables where the denominator is well-defined (stat's output universe matches a clean total): Contributors — Summary.TotalDevs File Hotspots — Summary.TotalFiles Directories — ReportData.TotalDirectories (new) Extensions — ReportData.TotalExtensions (new) Churn Risk — Summary.TotalFiles Bus Factor Risk — ReportData.TotalBusFactorFiles (new; see below) Top Commits — Summary.TotalCommits Skipped Coupling and Dev Network because --coupling-min-changes and --network-min-files filter before ranking, so "total pairs" isn't a clean denominator. BusFactor's universe isn't TotalFiles. The stat skips files where fe.devLines is empty (pure-rename-only files after the earlier ingest fix). Using Summary.TotalFiles as the denominator would lie on rename-heavy repos: kubernetes has 76,538 files but only 71,510 (93.4%) carry authored lines — a 5,028-file gap. Added BusFactorCount that excludes empty-devLines files and use it instead. DirectoryCount / ExtensionCount similarly dedicated to keep the helper lightweight (DirectoryStats with n=0 does expensive per-dir bus factor sorts we don't need just to count). Tests: TestDirectoryCountAndExtensionCount pins the counts on a small fixture AND asserts the invariant `Count == len(stat(ds, 0))`, so any future drift in derivation surfaces in CI. TestBusFactorCountExcludesEmptyDevLines covers the pure-rename skip specifically. Smoke: pi-hole shows "20 of 207" (8 pure-rename files excluded), kubernetes "20 of 71,510" (5,028 excluded). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the hidden-counter family started with Scope/Extensions. TopFiles truncates at 10 and Collaborators at 5; both used to drop buckets silently. A dev with 25 touched files or 12 frequent collaborators looked like they had exactly 10/5 — reader had no way to tell "this is the whole footprint" apart from "this is a sample of a larger set". The k8s-release-robot profile is a good example: 62 distinct collaborators and 18 top files, previously collapsed to the displayed top-N without trace.
Add TopFilesHidden and CollaboratorsHidden fields on DevProfile; populate at the truncation sites. Render in three surfaces matching the established pattern:
standalone " ... (+N more files not shown)" after Top files.
italic div below Top files.
colspan-4 row at the bottom of the Top Files table.
Silent when Hidden == 0 (the common case) so reports of tight teams don't gain noise.
Tests: TestDevProfileHiddenCountersTopFilesAndCollaborators constructs a dev with 18 authored files and 6 collaborators, asserts TopFilesHidden=8 and CollaboratorsHidden=1. TestDevProfileHiddenCountersZeroWhenFits extended to pin both new counters to 0 in the no-truncation case.
Verified on kubernetes/k8s-release-robot: CLI shows "(+57 more)" on Collaboration and "(+8 more files not shown)" at bottom of Top files; HTML dedicated profile shows both markers.